package middleware

import (
	"github.com/gogf/gf/net/ghttp"
)

func AuthMiddleware(r *ghttp.Request) {
	cliToken := r.Get("_token")
	if cliToken == "123456" {
		r.Middleware.Next()
	} else {
		//r.Response.WriteStatus(http.StatusForbidden)
		r.Response.WriteJsonExit(map[string]interface{}{"code":0,"info":"auth forbidden"})
	}
}
